package kr.jin.zeroprojectone;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class DBListAdapterStep4 extends BaseAdapter {
	Context mainContext;
	LayoutInflater Inflater;
	ArrayList<MyItemsDBList4> arSrc;
	int layout;
	

	public DBListAdapterStep4(Context mainContext, int layout, ArrayList<MyItemsDBList4> arSrc) {
		super();
		this.mainContext = mainContext;
		this.Inflater = (LayoutInflater)mainContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.arSrc = arSrc;
		this.layout = layout;
	}

	@Override
	public int getCount() {
		return arSrc.size();
	}
	
	
	@Override
	public Integer getItem(int position) {
		return arSrc.get(position).id4;
	}
	
	public String getItem1(int position) {
		return arSrc.get(position).date4;
	}
	
	public String getItem2(int position) {
		return arSrc.get(position).activity4;
	}
	
	public Long getItem3(int position) {
		return arSrc.get(position).totalTime4;
	}
	
	public String getItem4(int position) {
		return arSrc.get(position).startTime4;
	}
	
	public String getItem5(int position) {
		return arSrc.get(position).stopTime4;
	}
	

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		if(convertView == null){
			convertView = Inflater.inflate(layout,parent,false);
		}

		/*TextView dbListStep0 = (TextView) convertView.findViewById(R.id.dblistviewstep4_0);
		dbListStep0.setText(String.format("%d", arSrc.get(position).id4));*/
		
		TextView dbListStep1 = (TextView) convertView.findViewById(R.id.dblistviewstep4_1);
		dbListStep1.setText(arSrc.get(position).date4);
		
		TextView dbListStep2 = (TextView) convertView.findViewById(R.id.dblistviewstep4_2);
		dbListStep2.setText(arSrc.get(position).activity4);
		
		/*TextView dbListStep3 = (TextView) convertView.findViewById(R.id.dblistviewstep4_3);
		dbListStep3.setText(String.format("%d", arSrc.get(position).totalTime4));*/
		
		TextView dbListStep4 = (TextView) convertView.findViewById(R.id.dblistviewstep4_4);
		dbListStep4.setText(arSrc.get(position).startTime4);
		
		TextView dbListStep5 = (TextView) convertView.findViewById(R.id.dblistviewstep4_5);
		dbListStep5.setText(arSrc.get(position).stopTime4);
		
		return convertView;
	}

}